package com.glory.hzlionpda.utils;

import android.util.Log;

import com.glory.hzlionpda.base.Constant;
import com.pda.platform.ui.ui_pdaplatform.callback.FreeUI_EntityCallBack;
import com.pda.platform.ui.ui_pdaplatform.entity.FreeUI_VersionEntity;
import com.pda.platform.ui.ui_pdaplatform.utils_public.FreeApi_NetUtils;

import org.json.JSONObject;

import java.util.HashMap;
import java.util.Map;

/**
 * @author hx
 * @date 2019/6/27
 * @desc
 */
public class NetUtils {

    public static <T> void requestGetNet(String method,Object tag, JSONObject jsonObject,
                                      FreeUI_EntityCallBack<T> callBack) {
        Map<String,String> map= new HashMap<>();
        map.put("jsonString",jsonObject.toString());
        Log.e("request",jsonObject.toString());
        FreeApi_NetUtils.requestPostNet(Constant.REQUEST_URL+method,tag,map,callBack);
    }

    public static void requestUpdate( FreeUI_EntityCallBack<FreeUI_VersionEntity> callBack) {
        FreeApi_NetUtils.requestGetNet(Constant.FILE_URL, "requestUpdate", null, callBack);
    }
}
